package main

import "fmt"

type Dog struct {
	name string
}

func (d *Dog) SetName (name string) {
	d.name = name
}

func New(name string) Dog {
	return Dog{name}
}

func main() {
	obj := New("Snoopy")
	obj.SetName("Goofy")
	fmt.Println(obj.name)
	// New("Snoopy").SetName("Wishbone")  //
}